package com.zx.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.zx.annotation.CacheLock;
import com.zx.annotation.CacheParam;

@RestController
public class BookController {

    @CacheLock(prefix = "books")
    @GetMapping
    @RequestMapping("/books")
    public String query(@CacheParam(name = "token") @RequestParam String token){
        return "success - " + token;
    }

    @GetMapping
    @RequestMapping("/2")
    public String query1(String token){
        return "success - " + token;
    }


}